//
//  MarkDownTableViewCell.m
//  Car
//
//  Created by lanou on 15/9/21.
//  Copyright (c) 2015年 朱鸿儒. All rights reserved.
//

#import "MarkDownTableViewCell.h"

@implementation MarkDownTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self) {
        self.selectionStyle = 0;
        self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
        self.spepic = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 88, 66)];
        self.spepic.backgroundColor = [UIColor lightGrayColor];
        [self addSubview:self.spepic];
        
        self.name = [[UILabel alloc]initWithFrame:CGRectMake(100, 15 , kWidth - 105, 40)];
        self.name.numberOfLines = 2;
        [self addSubview:self.name];
        self.dealerprice = [[UILabel alloc]initWithFrame:CGRectMake(100, 55, 60, 16)];
        [self addSubview:self.dealerprice];
        self.facprice = [[UILabel alloc]initWithFrame:CGRectMake(180,55 , 80, 16)];
        [self addSubview:self.facprice];
        UIView *lineaa = [[UIView alloc]initWithFrame:CGRectMake(180, 63, 70, 0.5)];
        lineaa.backgroundColor = [UIColor redColor];
        [self addSubview:lineaa];
        
        self.orderrange = [[UILabel alloc]initWithFrame:CGRectMake(65, 75, 60, 20)];
        [self addSubview:self.orderrange];
        self.orderrange.font = [UIFont systemFontOfSize:10];
        self.orderrange.textColor = [UIColor redColor];
        self.shortname = [[UILabel alloc] initWithFrame:CGRectMake(125, 75, kWidth - 125, 20)];
        [self addSubview:self.shortname];
        self.shortname.font = [UIFont systemFontOfSize:10];
        self.shortname.textColor = [UIColor redColor];
        
        self.city = [[UILabel alloc] initWithFrame:CGRectMake(15, 75, 60, 20)];
        [self addSubview:self.city];
        self.city.font = [UIFont systemFontOfSize:10];
        self.city.textColor = [UIColor redColor];
        
        
        self.tele = [[UILabel alloc]initWithFrame:CGRectMake(5, 100, kWidth - 5, 20)];
        [self addSubview:self.tele];
        
        UIView *line = [[UIView alloc]initWithFrame:CGRectMake(10, 120, kWidth - 10, 0.5)];
        line.backgroundColor = [UIColor lightGrayColor];
        [self addSubview:line];
        
    }
    return self;
}

- (void)setWithModel:(MarkDownModel *)model{
    if ([Setting shareWithSetting].isOnPic == NO) {
    [self.spepic sd_setImageWithURL:[NSURL URLWithString:model.specpic]];
    }
    self.name.text = model.name;
    self.dealerprice.text = [NSString stringWithFormat:@"%@万",model.dealerprice];
    self.facprice.text = [NSString stringWithFormat:@"%@万",model.fctprice];
    self.orderrange.text = model.orderrange;
    self.shortname.text = model.shortname;
    self.city.text = model.city;
    self.tele.text = [NSString stringWithFormat:@"质询电话:%@", model.assellphone];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
